<template>
    <div class="wrapper">
        <h1>ElemRef</h1>
        <h2>中国</h2>
        <h3 ref="beijing">北京</h3>
        <h4>天安门</h4>
        <button @click="showLog">showLog</button>
        <ElemRefChildren ref="children"></ElemRefChildren>
        <button @click="showChildren">showChildren</button>
    </div>
</template>

<script lang="ts" setup name="ElemRef">

import { ref } from 'vue'
import ElemRefChildren from './ElemRefChildren.vue'

let beijing = ref()
let children = ref()

function showLog() {
    console.log('h2 :>> ', beijing.value);
}

function showChildren() {
    console.log('children :>> ', children.value);
}

</script>


<style scoped>
.wrapper {
    background-color: skyblue;
    box-shadow: 0 0 10px;
    border-radius: 10px;
    padding: 20px;
    margin: 20px
}

button {
    margin: 0 5px;
}
</style>